public class Player {

    int x;
    int y;
    String name;
    public void show()
    {
        System.out.println(name+"坐标是"+x+","+y);
    }

    public Player(int x, int y, String name) {
        this.x = x;
        this.y = y;
        this.name = name;
    }
    public Player( String name) {

        this.name = name;
    }
    public Player() {
    }

    public  void move(char direction)
    {
        if (direction=='w')
        {
            System.out.println("玩家向上移动，当前坐标为："+x+","+(++y));
        }

        else if (direction=='s')
        {
            System.out.println("玩家向下移动，当前坐标为："+x+","+(--y));
        }
        else if (direction=='a')
        {
            System.out.println("玩家向左移动，当前坐标为："+(--x)+","+y);
        }
        else if (direction=='d')
        {
            System.out.println("玩家向右移动，当前坐标为："+(++x)+","+y);
        }
    }


}
